/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author 7P7
 */
@Entity
@Table(name = "Enrolment", catalog = "NationalLevelPaperPresentation", schema = "dbo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Enrolment.findAll", query = "SELECT e FROM Enrolment e"),
    @NamedQuery(name = "Enrolment.findByEnrolmentID", query = "SELECT e FROM Enrolment e WHERE e.enrolmentID = :enrolmentID"),
    @NamedQuery(name = "Enrolment.findByIsPayment", query = "SELECT e FROM Enrolment e WHERE e.isPayment = :isPayment"),
    @NamedQuery(name = "Enrolment.findByEnrolDate", query = "SELECT e FROM Enrolment e WHERE e.enrolDate = :enrolDate"),
    @NamedQuery(name = "Enrolment.findByPayDate", query = "SELECT e FROM Enrolment e WHERE e.payDate = :payDate"),
    @NamedQuery(name = "Enrolment.findByPayValue", query = "SELECT e FROM Enrolment e WHERE e.payValue = :payValue")})
public class Enrolment implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "EnrolmentID", nullable = false)
    private Integer enrolmentID;
    @Column(name = "IsPayment")
    private Boolean isPayment;
    @Column(name = "EnrolDate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date enrolDate;
    @Column(name = "PayDate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date payDate;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "PayValue", precision = 18, scale = 2)
    private BigDecimal payValue;
    @JoinColumn(name = "StudentID", referencedColumnName = "StudentID")
    @ManyToOne
    private Student studentID;
    @JoinColumn(name = "PaymentID", referencedColumnName = "PaymentID")
    @ManyToOne
    private Payment paymentID;
    @JoinColumn(name = "EventID", referencedColumnName = "EventID")
    @ManyToOne
    private Event eventID;

    public Enrolment() {
    }

    public Enrolment(Integer enrolmentID) {
        this.enrolmentID = enrolmentID;
    }

    public Integer getEnrolmentID() {
        return enrolmentID;
    }

    public void setEnrolmentID(Integer enrolmentID) {
        this.enrolmentID = enrolmentID;
    }

    public Boolean getIsPayment() {
        return isPayment;
    }

    public void setIsPayment(Boolean isPayment) {
        this.isPayment = isPayment;
    }

    public Date getEnrolDate() {
        return enrolDate;
    }

    public void setEnrolDate(Date enrolDate) {
        this.enrolDate = enrolDate;
    }

    public Date getPayDate() {
        return payDate;
    }

    public void setPayDate(Date payDate) {
        this.payDate = payDate;
    }

    public BigDecimal getPayValue() {
        return payValue;
    }

    public void setPayValue(BigDecimal payValue) {
        this.payValue = payValue;
    }

    public Student getStudentID() {
        return studentID;
    }

    public void setStudentID(Student studentID) {
        this.studentID = studentID;
    }

    public Payment getPaymentID() {
        return paymentID;
    }

    public void setPaymentID(Payment paymentID) {
        this.paymentID = paymentID;
    }

    public Event getEventID() {
        return eventID;
    }

    public void setEventID(Event eventID) {
        this.eventID = eventID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (enrolmentID != null ? enrolmentID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Enrolment)) {
            return false;
        }
        Enrolment other = (Enrolment) object;
        if ((this.enrolmentID == null && other.enrolmentID != null) || (this.enrolmentID != null && !this.enrolmentID.equals(other.enrolmentID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Enrolment[ enrolmentID=" + enrolmentID + " ]";
    }
    
}
